package cn.wolfcode.luowowo.search.service.impl;

import cn.wolfcode.luowowo.search.repository.IDestinationRepository;
import cn.wolfcode.luowowo.search.service.IDestinationTemplateSearchService;
import cn.wolfcode.luowowo.search.template.DestinationTemplate;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;

@Service
public class DestinationTemplateSearchServiceImpl implements IDestinationTemplateSearchService {

    @Autowired
    private IDestinationRepository repository;

    @Autowired
    private ElasticsearchTemplate template;


    @Override
    public void saveOrUpdate(DestinationTemplate template) {
        repository.save(template);
    }

    @Override
    public DestinationTemplate findByName(String keyword) {
        return repository.findByName(keyword);
    }
}
